import rxAjax from '@/assets/js/ajax.js';

//站点配置 api接口
export const SysSiteSettingApi = {};

SysSiteSettingApi.baseUrl= '/api-system/system/core/sysSiteSetting';
SysSiteSettingApi.exportUrl= SysSiteSettingApi.baseUrl + '/listExport';

//查询列表
SysSiteSettingApi.query=function (parameter) {
  var url= SysSiteSettingApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
SysSiteSettingApi.get =function(pkId) {
  var url= SysSiteSettingApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
SysSiteSettingApi.save =function(parameter) {
  var url= SysSiteSettingApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
SysSiteSettingApi.del =function(parameter) {
  var url= SysSiteSettingApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

//获取站点配置数据
SysSiteSettingApi.getSysSiteSetting =function() {
    var url= SysSiteSettingApi.baseUrl + '/getSysSiteSetting';
    return rxAjax.get(url);
}

//获取站点配置数据
SysSiteSettingApi.getConfig =function() {
    var url= SysSiteSettingApi.baseUrl + '/getConfig';
    return rxAjax.get(url);
}

//保存或者修改操作
SysSiteSettingApi.saveOrUpdateConfig =function(parameter) {
    var url= SysSiteSettingApi.baseUrl + '/saveOrUpdateConfig';
    return rxAjax.postJson(url,parameter);
}

export  default SysSiteSettingApi;

